package com.novelastudios.events
{
	import flash.events.Event;

	/**
	 * 
	 * @author John Bailey
	 * 
	 */	
	public class GenericEvent extends Event
	{
		public static const GENERIC:String 		= "generic";
		public static const CHANGE:String		= "genericChange";
		public static const READY:String 		= "genericReady";
		public static const COMPLETE:String 	= "genericComplete";
		public static const SELECT:String		= "genericSelect";
		
		
		
		public function GenericEvent(type:String, data:Object=null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			_data = data ? data : {} ;
		}
		
		///////////////////////////////////////////////////////////////////////////////
		//								ACCESSORS
		///////////////////////////////////////////////////////////////////////////////
		
		///////////////////////////////
		//-------------------------
		//	data
		//-------------------------
		/**
		 * @private
		 */
		private var _data:Object;
		/** 
		 * 
		 */		
		public function get data():Object{
			return _data;
		}
		
		///////////////////////////////////////////////////////////////////////////////
		//								PUBLIC METHODS
		///////////////////////////////////////////////////////////////////////////////
		override public function toString():String 
		{
			return formatToString("GenericEvent", "type", "data", "bubbles", "cancelable");
		}
		
		/**
		 * @description  Returns a copy of the event instance.
		 *
		 * @returns  A copy of the event.
		 */
		override public function clone():Event
		{
			return new GenericEvent(type,data,bubbles,cancelable);	
		}
		
	}
}